<template>
  <div>
    <div class="crumbs">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item>
          <i class="el-icon-lx-cascades"></i> 用户列表
        </el-breadcrumb-item>
      </el-breadcrumb>
      <!--https://blog.csdn.net/weixin_30439067/article/details/95721811-->
    </div>
    <div class="container">
      <el-table
        :data="tableData"
        border
        class="table"
        ref="multipleTable"
        header-cell-class-name="table-header"
      >
        <el-table-column fixed prop="userId" label="用户id" width="150"></el-table-column>
        <el-table-column prop="name" label="用户名" width="150"></el-table-column>
        <el-table-column prop="roleId" label="权限id" width="150"></el-table-column>
        <el-table-column prop="nickname" label="微信名" width="150"></el-table-column>
        <el-table-column  prop="openid" label="openid" width="150"></el-table-column>
        <el-table-column prop="head_portrait" label="头像" width="250">
 <!--  eslint-disable-next-line --> <!--https://blog.csdn.net/HanXiaoXi_yeal/article/details/115365751-->
            <template #default="scope">
                        <img :src="scope.row.head_portrait" alt style="width: 150px;height:100px">
            </template>
        </el-table-column>
        <el-table-column prop="user_pwd" label="密码" width="160"></el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { userlist } from "../api/other";
export default {
  name: "userinfo",
  data() {
    return {
      tableData: [],
      form: {
        userId: "",
        name: "",
        roleId: "",
        nickname: "",
        openid: "",
        head_portrait: "",
        user_pwd: ""
      },
      imgUrl:''
    };
  },
  created() {
    this.getData();
  },
  methods: {
    // 获取 easy-mock 的模拟数据
    getData() {
      userlist().then(res => {
          console.log(res)
        this.tableData = res.data.list;
      });
    },
  }
};
</script>

<style scoped>
.handle-box {
  margin-bottom: 20px;
}

.handle-select {
  width: 120px;
}

.handle-input {
  width: 300px;
  display: inline-block;
}
.table {
  width: 100%;
  font-size: 14px;
}
.red {
  color: #ff0000;
}
.mr10 {
  margin-right: 10px;
}
.table-td-thumb {
  display: block;
  margin: auto;
  width: 40px;
  height: 40px;
}
</style>
